import {
  wxRequest,
  wxRequestWithJwt,
  wxRequestGoodsList,
  wxRequestWithTime
} from '@/utils/wxRequest';
import {
  microserviceDictionary
} from '@/utils/microserviceDictionary';

let env = "-test" //-dev 或者 -test

// 尺码信息域名
const sizeChart = 'https://www.cosstores.cn/cos/rest'

// 当前接口环境及埋点sdk环境 formal为正式环境 trial为测试环境

let baseUrl = "https://api.cloud.efashionchina.com";
let environment = "trial"
let envVersion = wx.getAccountInfoSync().miniProgram.envVersion;
// 版本及api改动说明
// 开发版：模拟器工具访问以及模拟器生成预览码，真机调试码，进入都是开发版，开发测试可以修改对应的environment
// 体验版：模拟器发行版本，并在mp小程序后台把该版本选为指定版本，开发测试可以修改对应的environment
// 正式版：线上生产环境版本，禁止修改
switch (envVersion) {
  case "develop": // 开发版
    // environment = "formal" //开发版-正式环境数据
    environment = "trial" //开发版-测试环境
    break;
  case "trial": // 体验版
    environment = "trial" //体验版-测试环境数据
    // environment = "formal"  //体验版-正式环境数据
    break;
  case "release": // 正式版
    //正式版正式环境 禁止修改！ 禁止修改！ 禁止修改！ 禁止修改！
    environment = "formal"
}
let envJson = microserviceDictionary[environment]
// https://api.sandbox.cloud.efashionchina.com
baseUrl = environment == "trial" ? "https://macallan.morefun.me" : "https://api.cloud.efashionchina.com"
wx.reportEvent("environment_console", {
  "environment": environment,
  "baseurl": baseUrl,
  "env_version": wx.getAccountInfoSync().miniProgram.envVersion,
  "version": wx.getAccountInfoSync().miniProgram.version,
  "app_id": wx.getAccountInfoSync().miniProgram.appId,
  "environment_params": JSON.stringify(uni.getSystemInfoSync())
})
// console.log(`版本号信息输出：---environment:${environment};  baseUrl:${baseUrl};getAccountInfoSync:`, wx.getAccountInfoSync())
export default {
  baseUrl,
  environment,
  //查询尺码
  getSizeChart: (params) => wxRequest(params, sizeChart + '/product?action=getSizeChart'),

  //获取门店城市列表
  getCityListInterface: (params) => wxRequest(params,
    'https://api.storelocator.hmgroup.tech/v2/brand/cos/locations/locale/zh_CN/country/CN/cities'),

  //根据城市id查门店列表
  getStoreListInterface: (params, cityId) => wxRequest(params,
    'https://api.storelocator.hmgroup.tech/v2/brand/cos/stores/locale/zh_CN/country/CN/city/' + cityId +
    '?openinghours=true&departments=true'),


  // 封装api
  // /website-store-service 微服务
  //CMS
  cmsConfigList: (params) => wxRequest(params, baseUrl, '/website-store-service', envJson['/website-store-service'],
    '/store/get'),
  //获取商户信息
  merchantInfo: (app_id) => wxRequest('', baseUrl, '/website-store-service', envJson['/website-store-service'],
    '/public/store/miniprogram/get?appId=' + app_id),
  //一级分类
  rootCtegoryList: (params) => wxRequest(params, baseUrl, '/website-store-service', envJson[
    '/website-store-service'], '/customer/store/class/get'),
  // 获取用户自定义配置  获取模板ID
  customize: (params) => wxRequest(params, baseUrl, '/website-store-service', envJson['/website-store-service'],
    '/store/get'),


  // /cloud-advertising-service
  //分类banner
  categoryCmsBanners: (params) => wxRequest(params, baseUrl, '/cloud-advertising-service', envJson[
    '/cloud-advertising-service'], '/customer/merchant/advertise/scene'),



  // /cloud-item-basic
  // getGoodsList: (params) => wxRequest(params, baseUrl, '/cloud-item-basic', envJson['/cloud-item-basic'], '/elasticsearch/item'),
  getGoodsList: (params) => wxRequest(params, baseUrl, '/cloud-item-basic', envJson['/cloud-item-basic'],
    '/customer/elasticsearch/item'),
  // 新版查询商品列表接口
  getGoodsListNew: (params) => wxRequest(params, baseUrl, '/cloud-item-basic', envJson['/cloud-item-basic'],
    '/customer/elasticsearch/fast'),
  // 查询商品列表接口不过滤不可搜索商品
  getAllGoodsList: (params) => wxRequest(params, baseUrl, '/cloud-item-basic', envJson['/cloud-item-basic'],
    '/customer/elasticsearch/cms_page'),


  getGoodsListFilter: (params) => wxRequest(params, baseUrl, '/cloud-item-basic', envJson['/cloud-item-basic'],
    '/customer/elasticsearch/filter_results'),

  //查询商品详情信息
  goodsDetail: (params, id) => wxRequest(params, baseUrl, '/cloud-item-basic', envJson['/cloud-item-basic'],
    '/customer/elasticsearch/item/' + id),
  //查询商品促销信息
  goodsPromotion: (params, merchantId, storeId, goodsId, valueId) => wxRequest(params, baseUrl,
    '/cloud-item-basic', envJson['/cloud-item-basic'], '/promotion_tag/' + merchantId + '/' + storeId + '/' +
    goodsId + '/' + valueId),
  //查询商品促销信息
  cartPromotion: (merchantId, storeId, params) => wxRequest(params, baseUrl, '/cloud-item-basic', envJson[
    '/cloud-item-basic'], '/customer/promotion_tag/batch?merchant_id=' + merchantId + '&store_id=' + storeId),
  //查询cc策略价格
  getPriceRules: (params, merchantId, itemId, valueId) => wxRequest(params, baseUrl, '/cloud-item-basic',
    envJson['/cloud-item-basic'], '/item_strategy/' + merchantId + '/' + itemId + '/' + valueId),
  //按参数获取商品信息 直接调用efs
  getGoodsInfo: (params, item_code, merchant_id) => wxRequest(params, baseUrl, '/cloud-item-basic', envJson[
    '/cloud-item-basic'], '/item/item?item_code=' + item_code + '&merchant_id=' + merchant_id),
  //pdp 获取店铺商品上下架状态
  getApproveStatus: (params) => wxRequest(params, baseUrl, '/cloud-item-basic', envJson['/cloud-item-basic'],
    '/customer/store_item_sale_status/pdp_approve_status'),
  // 收藏接口 start
  // 多条件查询商品信息 itemId(商品id) valueId(颜色id),
  inquireFavorites: (params) => wxRequest(params, baseUrl, '/cloud-item-basic', envJson['/cloud-item-basic'],
    '/customer/item_favorites/pdp_favorites'),
  // 新增商品收藏信息 POST frontCode(颜色),
  appendFavorites: (params) => wxRequest(params, baseUrl, '/cloud-item-basic', envJson['/cloud-item-basic'],
    '/customer/item_favorites'),
  // 删除商品收藏信息 method:PUT
  delFavorites: (params, favoritesId) => wxRequest(params, baseUrl, '/cloud-item-basic', envJson[
    '/cloud-item-basic'], '/customer/item_favorites/' + favoritesId),
  // 获取客户商品收藏信息列表
  getFavoritesItems: (params) => wxRequest(params, baseUrl, '/cloud-item-basic', envJson['/cloud-item-basic'],
    '/customer/item_favorites/list'),
  // 获取单条商品收藏详情  method:GET
  getFavoriteDetail: (params, favoritesId) => wxRequest(params, baseUrl, '/cloud-item-basic', envJson[
    '/cloud-item-basic'], '/customer/item_favorites/' + favoritesId),
  // 按多条件查询商品搭配推荐信息(PDP)（Customer调用）
  getRecommendItem: (params, merchantId, storeId, itemId, valueId) => wxRequest(params, baseUrl,
    '/cloud-item-basic', envJson['/cloud-item-basic'], '/customer/item_recommend/' + merchantId + '/' + storeId +
    '/' + itemId + '/' + valueId),
  //获取单个SKU详情
  getSkuDetail: (params, skuId) => wxRequest(params, baseUrl, '/cloud-item-basic', envJson['/cloud-item-basic'],
    '/customer/item_sku/' + skuId, false),
  itemArrivalNotice: (params) => wxRequest(params, baseUrl, '/cloud-item-basic', envJson['/cloud-item-basic'],
    '/customer/item_arrival_notice'),
  itemArrivalNoticeCancel: (params, noticeId) => wxRequest(params, baseUrl, '/cloud-item-basic', envJson[
    '/cloud-item-basic'], '/customer/item_arrival_notice/' + noticeId),
  itemArrivalNoticeList: (params) => wxRequest(params, baseUrl, '/cloud-item-basic', envJson['/cloud-item-basic'],
    '/customer/item_arrival_notice/list'),


  // /basic-auto-number
  // dashboard统计搜索词 start
  // 搜索词，获取uid 搜索词，新增uid字段
  basicAutoNumber: (params) => wxRequest(params, baseUrl, '/basic-auto-number', envJson['/basic-auto-number'],
    '/basic_auto_number'),



  // /cloud-merchant-extend
  // 记录用户搜索热词 Methods:POST 进行搜索词的搜索操作时，取出缓存中的uid，赋值给接口的uid参数
  recordSearchTerm: (params) => wxRequest(params, baseUrl, '/cloud-merchant-extend', envJson[
    '/cloud-merchant-extend'], '/customer/merchant_store_search_term'),
  // 商户二维码扫码记录
  scanLog: (params) => wxRequest(params, baseUrl, '/cloud-merchant-extend', envJson['/cloud-merchant-extend'],
    '/merchant_qrcode_scan_log/service'),
  // 新增商户Utm日志（method:POST）门店扫码追踪功能
  merchantUtmLog: (params) => wxRequest(params, baseUrl, '/cloud-merchant-extend', envJson[
    '/cloud-merchant-extend'], '/customer/merchant_utm_log'),
  // 判断支付方式
  checkoutPayType: (params) => wxRequest(params, baseUrl, '/cloud-merchant-extend', envJson[
    '/cloud-merchant-extend'], '/merchant_extend_config/customer'),
  //查询关键字（热词）列表
  searchKeywordList: (params) => wxRequest(params, baseUrl, '/cloud-merchant-extend', envJson[
    '/cloud-merchant-extend'], '/customer/merchant_store_hotword'),
  //二级三级分类
  childGoodsCatetoryList: (params) => wxRequest(params, baseUrl, '/cloud-merchant-extend', envJson[
    '/cloud-merchant-extend'], '/customer/merchant_class'),
  // 获取商户导航信息列表
  // merchantNavigation: (params, parentNavId, storeId) => wxRequest(params, baseUrl, '/cloud-merchant-extend',
  //   envJson['/cloud-merchant-extend'], '/merchant_navigation?parent_nav_id=' + parentNavId + '&store_id=' + storeId),
  merchantNavigation: (params, parentNavId, storeId) => wxRequest(params, baseUrl, '/cloud-merchant-extend',
    envJson['/cloud-merchant-extend'], '/merchant_navigation'),
  // 获取小程序页面配置详情CMS
  getConfigDetail: (params) => wxRequestWithTime(params, baseUrl, '/cloud-merchant-extend', envJson[
    '/cloud-merchant-extend'],
    '/customer/cms_page/details/customer'),
  // getConfigDetail: (params) => wxRequest(params, baseUrl, '/cloud-merchant-extend', envJson['/cloud-merchant-extend'],
  //   '/customer/cms_page/details/customer'),
  // 获取pdp页面参数
  sourceLog: (params) => wxRequest(params, baseUrl, '/cloud-merchant-extend', envJson['/cloud-merchant-extend'],
    '/customer/merchant_utm_log'),



  // /cloud-item-inventory
  // pdp查询实时库存
  getAvailableQty: (params, merchant_id, sku_code) => wxRequest(params, baseUrl, '/cloud-item-inventory',
    envJson['/cloud-item-inventory'], '/customer/item_sku/' + merchant_id + '/' + sku_code),



  // /cloud-arrival-remind
  // 到货提醒
  arrivalRemind: (params) => wxRequest(params, baseUrl, '/cloud-arrival-remind', envJson[
    '/cloud-arrival-remind'], '/customer/arrival_remind'),
  // 到货提醒相关
  queryArrivalResult: (params) => wxRequest(params, baseUrl, '/cloud-arrival-remind', envJson['/cloud-arrival-remind'],
    '/customer/subscribe'),
  wxArrivalNotice: (params) => wxRequest(params, baseUrl, '/cloud-arrival-remind', envJson['/cloud-arrival-remind'],
    '/customer/arrival_remind'),
  wxArrivalNoticeCancel: (params, skuCode) => wxRequest(params, baseUrl, '/cloud-arrival-remind', envJson[
    '/cloud-arrival-remind'], '/customer/cancel_remind?skuCode=' + skuCode),



  // /global-config-service
  //获取搭配推荐配置信息
  getRecommendConfigValue: (params) => wxRequest(params, baseUrl, '/global-config-service', envJson[
    '/global-config-service'], '/customer/config/value/by_path'),
  // 获取小程序店铺LOGO和名称
  getStoreInfo: (params) => wxRequest(params, baseUrl, '/global-config-service', envJson['/global-config-service'],
    '/customer/config/value/by_path'),



  // /ai-similar-product
  // 写入基础数据（用户、商品、用户浏览商品行为 POST type:user(获取uuid),
  getRecommendwriter: (params) => wxRequest(params, baseUrl, '/ai-similar-product', envJson[
    '/ai-similar-product'], '/customer/recommend/write'),
  // 获取推荐商品
  getRecommendList: (params) => wxRequest(params, baseUrl, '/ai-similar-product', envJson['/ai-similar-product'],
    '/customer/recommend/get'),
  // 用户点击推荐商品 post
  userClickRecommendItem: (params) => wxRequest(params, baseUrl, '/ai-similar-product', envJson[
    '/ai-similar-product'], '/customer/recommend/click'),



  // /cloud-sales-cart
  // 设置UTM（Customer调用）分销扫码进入，下单之前调用 门店扫码追踪功能
  setUTM: (params, cartKey) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson['/cloud-sales-cart'],
    '/customer/sales_cart/' + cartKey + '/utm'),
  //检测购物车
  checkCart: (params) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson['/cloud-sales-cart'],
    '/customer/sales_cart/exists', false),
  // 创建购物车
  initCart: (params) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson['/cloud-sales-cart'],
    '/customer/sales_cart', false),
  //商品加入购物车
  addCart: (params, cartKey) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson['/cloud-sales-cart'],
    '/customer/sales_cart/' + cartKey),
  // 查询购物车
  getCartList: (params, cartKey) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson['/cloud-sales-cart'],
    '/customer/sales_cart/' + cartKey, false),
  //购物车的商品选中状态
  cartCheck: (params, cartKey, isChecked, sku_id) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson[
    '/cloud-sales-cart'], '/customer/sales_cart/' + cartKey + '/item/checked?is_checked=' + isChecked + '&sku_id=' +
  sku_id),
  //购物车的商品选中状态(全选),
  cartCheckAll: (params, cartKey, isChecked) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson[
    '/cloud-sales-cart'], '/customer/sales_cart/' + cartKey + '/item/checked/all?is_checked=' + isChecked),
  //购物车的商品删除
  cartDel: (params, cartKey, skuId) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson[
    '/cloud-sales-cart'], '/customer/sales_cart/' + cartKey + '/item/' + skuId),
  //购物车的商品数量更新
  cartUpdateNum: (params, cartKey, num, sku_id) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson[
    '/cloud-sales-cart'], '/customer/sales_cart/' + cartKey + '/item_qty?qty=' + num + '&sku_id=' + sku_id),
  // 支付页获取优惠券列表(王兴接口),
  getPayCouponItem: (params, cartKey) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson[
    '/cloud-sales-cart'], '/customer/sales_cart/' + cartKey + '/coupon'),
  //去结算订单页面
  checkoutOrder: (params, cartKey) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson[
    '/cloud-sales-cart'], '/customer/sales_cart/' + cartKey + '/checkout'),
  //设置订单地址
  setOrderAddressId: (params, cartKey, addressId) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson[
    '/cloud-sales-cart'], '/customer/sales_cart/' + cartKey + '/checkout/customer_address?customer_address_id=' +
  addressId),
  //订单地址无效问题修复
  setOrderAddressIdNew: (params, cartKey, addressId) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson[
    '/cloud-sales-cart'], '/customer/sales_cart/' + cartKey + '/checkout/customer_address?customer_address_id=' +
  addressId),
  //设置支付方式
  setOrderPayType: (params, cartKey, payType) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson[
    '/cloud-sales-cart'], '/customer/sales_cart/' + cartKey + '/checkout/pay_type?pay_type=' + payType),
  //使用优惠券
  useCoupon: (params, cartKey, coupon_code) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson[
    '/cloud-sales-cart'], '/customer/sales_cart/' + cartKey + '/checkout/coupon_code?coupon_code=' + coupon_code),
  // 取消使用优惠券
  clearCoupon: (params, cartKey) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson['/cloud-sales-cart'],
    '/customer/sales_cart/' + cartKey + '/clear/coupon_code'),
  buyNow: (params) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson['/cloud-sales-cart'],
    '/customer/sales_cart/checkout/direct'),
  //设置订单备注
  setOrderRemarks: (params, cartKey) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson['/cloud-sales-cart'],
    '/customer/sales_cart/' + cartKey + '/checkout/buyer_remark'),
  // 获取pdp页面参数
  sourceBind: (params, cartKey) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson['/cloud-sales-cart'],
    '/customer/sales_cart/' + cartKey + '/utm'),
  //清空购物车无效商品
  emptyInvalidItems: (params, cartKey) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson['/cloud-sales-cart'],
    '/customer/sales_cart/' + cartKey + '/invalid_item'),



  // /cloud-sales-order
  // 修改订单userName
  scanLogSelleNote: (params, orderId) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson[
    '/cloud-sales-order'], '/sales_order/' + orderId + '/user_name/customer'),
  //支付前生成订单
  // saveByCart: (params) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson['/cloud-sales-order'], '/customer/sales_order'),
  //支付前生成订单
  saveByCart: (params) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson['/cloud-sales-order'],
    '/customer/sales_order/place_order'),
  //支付统一下单 /cloud-weixin-payment/wx_payment_order/unified_order/simple
  toPay: (params) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson['/cloud-sales-order'],
    '/customer/wx_payment/unified_order'),
  // 收钱吧同一下单接口
  Shouqianba: (params) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson['/cloud-sales-order'],
    '/wosai_payment/unified_order'),
  // 获取收钱吧token
  getSqbToken: (params) => wxRequestWithJwt(params, baseUrl, '/cloud-sales-order', envJson['/cloud-sales-order'],
    '/customer/wosai_payment/purchase'),
  indiscriminatePay: (params) => wxRequestWithJwt(params, baseUrl, '/cloud-sales-order', envJson['/cloud-sales-order'],
    '/customer/aggregation_payment/unified_order'),
  // 礼品卡支付统一下单接口
  giftCardPay: (params) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson['/cloud-sales-order'],
    '/customer/aggregation_payment/unified_order'),
  // 查询聚合订单状态
  checkOrderStatus: (params, orderId) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson[
    '/cloud-sales-order'], '/customer/aggregation_payment/' + orderId + '/status/customer'),
  //查询我的订单
  getMyOrderList: (params) => wxRequestWithTime(params, baseUrl, '/cloud-sales-order', envJson['/cloud-sales-order'],
    '/customer/sales_order/customer?'),
  //查询我的数量
  getMyOrderListCount: (params) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson[
    '/cloud-sales-order'], '/customer/sales_order/get_group_count'),
  //根据订单号查询详情
  getOrderInfo: (params, orderId) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson[
    '/cloud-sales-order'], '/customer/sales_order/' + orderId + '/customer'),
  getOrderInfoWithTime: (params, orderId) => wxRequestWithTime(params, baseUrl, '/cloud-sales-order', envJson[
    '/cloud-sales-order'], '/customer/sales_order/' + orderId + '/customer'),
  //根据订单ID获取物流包裹
  getShipmentList: (params, orderId) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson[
    '/cloud-sales-order'], '/customer/sales_shipment/shipment/' + orderId + '/customer'),
  //取消订单
  cancelOrder: (params, orderId) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson[
    '/cloud-sales-order'], '/customer/sales_order/' + orderId + '/cancel'),
  //确认收货
  submitOrder: (params, orderCode) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson[
    '/cloud-sales-order'], '/customer/sales_shipment/confirm?order_code=' + orderCode),
  //判断是否可以申请退货(正式环境),
  isAllowapplyRefund: (params, orderId) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson[
    '/cloud-sales-order'], '/customer/sales_order/is_allow_apply_refund/customer/' + orderId),
  //判断是否可以确认收货(正式环境),
  isAllowConfirm: (params, orderId) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson[
    '/cloud-sales-order'], '/customer/sales_order/is_allow_confirm/customer/' + orderId),
  //退货操作 申请退货
  refundApply: (params) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson['/cloud-sales-order'],
    '/customer/sales_refund/customer/apply/v2'),
  //获取订单退货类型(整单all,单个single,无退款none),
  refundType: (params, orderId) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson[
    '/cloud-sales-order'], '/customer/sales_refund/customer/refund/refund_type/' + orderId),
  //退款原因
  refundReason: (params) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson['/cloud-sales-order'],
    '/customer/sales_refund/customer/refund/reason'),
  //订单状态
  orderStatus: (params, orderId) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson[
    '/cloud-sales-order'], '/customer/sales_refund/customer/refunds/order_id/' + orderId),
  //退货列表
  getOrderRefundList: (params) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson['/cloud-sales-order'],
    '/customer/sales_refund/customer/refunds?'),
  //退款单详情
  getRefundInfo: (params, refundId) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson[
    '/cloud-sales-order'], '/customer/sales_refund/customer/refund/' + refundId),
  //买家退货
  buyerReturn: (params) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson['/cloud-sales-order'],
    '/customer/sales_refund/customer/return'),
  //快递公司列表
  expressList: (params) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson['/cloud-sales-order'],
    '/customer/sales_express/customer'),
  //获取退款列表（Customer调用）
  getRefundsList: (params) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson['/cloud-sales-order'],
    '/customer/sales_refund/customer/refunds'),
  // 买家申请取消退款
  cancelRefund: (params, refundId) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson[
    '/cloud-sales-order'], '/customer/sales_refund/customer/refund/closed/' + refundId),
  //根据OrderItemId获取退款单
  getRefundListByOrderItemId: (params, orderItemId) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson[
    '/cloud-sales-order'], '/customer/sales_refund/customer/refund/order_item_id/' + orderItemId),
  // 发票 Begin  小程序只能申请蓝票
  // getwosaiInvoiceBlue: (params, orderId) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson['/cloud-sales-order'], '/customer/wosai_invoice/' + orderId + '/blue'),
  // 申请蓝票接口更改
  getwosaiInvoiceBlue: (params, order_id) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson[
    '/cloud-sales-order'], '/customer/yide_invoice/' + order_id + '/blue'),
  // 计算开发票金额
  getwosaiInvoiceAmount: (params, orderId) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson[
    '/cloud-sales-order'], '/customer/wosai_invoice/' + orderId + '/amount'),
  //获取发票列表 get
  getInvoiceList: (params) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson['/cloud-sales-order'],
    '/customer/wosai_invoice'),
  //获取发票详情 POST
  //  getInvoiceDetail: (params, orderId, tasksn) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson['/cloud-sales-order'], '/customer/wosai_invoice/' + orderId + '/' + tasksn + '/query'),
  getInvoiceDetail: (params, orderId, task_sn) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson[
    '/cloud-sales-order'], '/customer/yide_invoice/' + orderId + '/' + task_sn + '/query'),
  //邮件发送 POST 重发邮件
  invoiceSaveToEail: (params, orderId) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson[
    '/cloud-sales-order'], '/customer/wosai_invoice/' + orderId + '/resend_email'),



  // /crm-member-basic
  // 获取会员信息
  getMemberDetails: (params) => wxRequest(params, baseUrl, '/crm-member-basic', envJson['/crm-member-basic'],
    '/customer/member'),
  // 加入会员(method:PUT),
  memberActive: (params) => wxRequest(params, baseUrl, '/crm-member-basic', envJson['/crm-member-basic'],
    '/customer/member/active'),
  // 修改会员信息(method:PUT),
  memberUpdate: (params) => wxRequest(params, baseUrl, '/crm-member-basic', envJson['/crm-member-basic'],
    '/customer/member'),
  // 获取会员等级信息
  getMemberLevel: (params, id) => wxRequest(params, baseUrl, '/crm-member-basic', envJson['/crm-member-basic'],
    '/customer/member/level/' + id),


  // /crm-coupon-basic
  // 获取优惠券列表(method:GET),
  getMemberCoupons: (params) => wxRequest(params, baseUrl, '/crm-coupon-basic', envJson['/crm-coupon-basic'],
    '/customer/coupon'),
  // 领取优惠券 couponRuleId 暂时传 3,4 (method: POST),
  acquireCoupon: (params) => wxRequest(params, baseUrl, '/crm-coupon-basic', envJson['/crm-coupon-basic'],
    '/customer/coupon'),
  // 获取优惠券列表 Get coupons for member (method:GET),
  getCouponItem: (params) => wxRequest(params, baseUrl, '/crm-coupon-basic', envJson['/crm-coupon-basic'],
    '/customer/coupon'),
  // 获取用户的有效优惠券
  getValidCoupon: (params, couponRuleIds) => wxRequest(params, baseUrl, '/crm-coupon-basic', envJson[
    '/crm-coupon-basic'], '/customer/coupon/by_rule_ids?coupon_rule_ids=' + couponRuleIds),



  // /crm-transaction-basic
  // Get transaction amounts 交易接口 用户消费金额
  getTransactionAmounts: (params) => wxRequest(params, baseUrl, '/crm-transaction-basic', envJson[
    '/crm-transaction-basic'], '/customer/transaction/amounts'),



  // /cloud-customer-basic
  // 解密unionId
  decodeUnionId: (params, appId) => wxRequest(params, baseUrl, '/cloud-customer-basic', envJson[
    '/cloud-customer-basic'], '/customer/customer_app/union_id/' + appId),
  //获取用户openid
  // obtainUserOpenid: (params) => wxRequest(params, baseUrl, '/cloud-customer-basic', envJson['/cloud-customer-basic'], '/customer/customer/obtain_user_openid?app_id=' + params.app_id + '&js_code=' + params.code),
  //获取用户openid
  obtainUserOpenid: (params) => wxRequest(params, baseUrl, '/cloud-customer-basic', envJson[
    '/cloud-customer-basic'], '/customer/customer/jscode2session'),
  //获取用户信息
  getCustomerInfo: (params, customer_id, merchant_id) => wxRequest(params, baseUrl, '/cloud-customer-basic',
    envJson['/cloud-customer-basic'], '/customer/customer?customer_id=' + customer_id + '&merchant_id=' + merchant_id
  ),
  checkUser: (params) => wxRequest(params, baseUrl, '/cloud-customer-basic', envJson['/cloud-customer-basic'],
    '/customer/customer_app/check'),
  //用户手机绑定
  registerUser: (params) => wxRequest(params, baseUrl, '/cloud-customer-basic', envJson['/cloud-customer-basic'],
    '/customer/customer_app/binding'),
  //用户收货地址
  getUserAddress: (params) => wxRequest(params, baseUrl, '/cloud-customer-basic', envJson['/cloud-customer-basic'],
    '/customer/customer_address'),
  //保存用户收货地址
  saveAddress: (params, customer_id) => wxRequest(params, baseUrl, '/cloud-customer-basic', envJson[
    '/cloud-customer-basic'], '/customer/customer_address?customer_id=' + customer_id),
  //更新用户地址
  updateAddress: (params, customer_id, addressId) => wxRequest(params, baseUrl, '/cloud-customer-basic', envJson[
    '/cloud-customer-basic'], '/customer/customer_address/' + customer_id + '/' + addressId),
  //用户收货地址根据id查询 获取顾客地址信息
  getAddressInfoById: (params, customer_id, addressId) => wxRequest(params, baseUrl, '/cloud-customer-basic', envJson[
    '/cloud-customer-basic'], '/customer/customer_address/' + customer_id + '/' + addressId),
  //根据Id删除收货地址
  delUserAddress: (params, customer_id, addressId) => wxRequest(params, baseUrl, '/cloud-customer-basic', envJson[
    '/cloud-customer-basic'], '/customer/customer_address/' + customer_id + '/' + addressId),

  // 修改订单收货地址	customer/sales_order/receiver/
  upOrderAddress: (params, orderNo) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson[
    '/cloud-sales-order'], '/customer/sales_order/receiver/' + orderNo),

  getBothUserId: (params, appid) => wxRequest(params, baseUrl, '/cloud-customer-basic', envJson[
    '/cloud-customer-basic'], '/customer/customer_app/info?app_id=' + appid),

  checkBlackList: (params) => wxRequest(params, baseUrl, '/cloud-customer-basic', envJson[
    '/cloud-customer-basic'], '/customer/mobile_blacklist/check/customer'),
  // https://gateway/cloud-customer-basic/customer/mobile_blacklist/check/customer


  // /cloud-weixin-mini
  checkText: (params, app_id) => wxRequest(params, baseUrl, '/cloud-weixin-mini', envJson['/cloud-weixin-mini'],
    '/sec_check/sec_check?app_id=' + app_id),
  //获取用户手机号码
  getUserPhoneNumber: (params, app_id) => wxRequest(params, baseUrl, '/cloud-weixin-mini', envJson[
    '/cloud-weixin-mini'], '/wx/user/' + app_id + '/phone/by_openid'),



  // /basic-sms-aliyun
  //发送短信
  sendVerifyCode: (params) => wxRequest(params, baseUrl, '/basic-sms-aliyun', envJson['/basic-sms-aliyun'],
    '/verify_code/template/send_verify_code'),
  //验证短信验证码
  validateVerifyCode: (params) => wxRequest(params, baseUrl, '/basic-sms-aliyun', envJson['/basic-sms-aliyun'],
    '/verify_code/validate_verify_code'),



  // /basic-sms-miaoxin
  //发送短信
  sendVerifyCodeNew: (params) => wxRequest(params, baseUrl, '/basic-sms-miaoxin', envJson['/basic-sms-miaoxin'],
    '/public/send'),
  //验证短信验证码
  validateVerifyCodeNew: (params) => wxRequest(params, baseUrl, '/basic-sms-miaoxin', envJson[
    '/basic-sms-miaoxin'], '/public/verify_code/validate'),



  // /basic-logistics-kuaidi100
  //根据物流公司编码 和 物流单号 查寻物流信息
  getOrderExpress: (params) => wxRequest(params, baseUrl, '/basic-logistics-kuaidi100', envJson[
    '/basic-logistics-kuaidi100'], '/customer/kuaidi100/poll/v2'),



  // /basic-china-area
  //获取省份列表
  getProvinceList: (params) => wxRequest(params, baseUrl, '/basic-china-area', envJson['/basic-china-area'],
    '/basic_china_area'),
  //获取城市列表
  getCityList: (city_code) => wxRequest(undefined, baseUrl, '/basic-china-area', envJson['/basic-china-area'],
    '/basic_china_area/city_code/v2/' + city_code),
  //获取区域列表
  getAreaList: (state_code) => wxRequest(undefined, baseUrl, '/basic-china-area', envJson['/basic-china-area'],
    '/basic_china_area/state_code/v2/' + state_code),

  //获取区域列表
  getAreasListNew: (params) => wxRequestWithJwt(params, baseUrl, '/basic-china-area', envJson['/basic-china-area'],
    '/basic_china_area/v3'),

  // /cloud-qrcode-service
  // 获取pdp页面参数
  getParamsByScene: (params, scene) => wxRequest(params, baseUrl, '/cloud-qrcode-service', envJson[
    '/cloud-qrcode-service'], '/scene/' + scene),



  // /activation-code-service
  //校验文本敏感词
  //checkText:(params,stringParams) => wxRequest(params, baseUrl, '/activation-code-service', envJson['/activation-code-service'], '/customer/check/content'+stringParams),




  // /crm-points-service
  //可兑礼列表
  redeemListGift: (params) => wxRequest(params, baseUrl, '/crm-points-service', envJson['/crm-points-service'],
    '/customer/redeem/list-gift'),
  //已兑礼品详情
  redeemedGiftInfo: (params, giftId) => wxRequest(params, baseUrl, '/crm-points-service', envJson[
    '/crm-points-service'], '/customer/redeem/list-gift/' + giftId + '/info'),
  //兑换礼品
  redeemGift: (params) => wxRequest(params, baseUrl, '/crm-points-service', envJson['/crm-points-service'],
    '/customer/redeem'),
  //可兑换优惠券
  redeemListCoupon: (params) => wxRequest(params, baseUrl, '/crm-points-service', envJson['/crm-points-service'],
    '/customer/redeem/list-coupon'),
  //兑换优惠券
  redeemCoupon: (params) => wxRequest(params, baseUrl, '/crm-points-service', envJson['/crm-points-service'],
    '/customer/redeem'),
  // /crm-points-basic
  //积分明细
  pointsTransaction: (params) => wxRequest(params, baseUrl, '/crm-points-basic', envJson['/crm-points-service'],
    '/customer/points/transaction'),
  //积分明细类型
  pointsTransactionTypes: (params) => wxRequest(params, baseUrl, '/crm-points-basic', envJson['/crm-points-service'],
    '/customer/points/transaction/types'),
  //积分总览
  pointsInfo: (params) => wxRequest(params, baseUrl, '/crm-points-basic', envJson['/crm-points-service'],
    '/customer/points/balance'),



  // /cloud-review-service
  // 评论相关接口
  isEnableEvaluate: (params) => wxRequest(params, baseUrl, '/cloud-review-service', envJson['/cloud-review-service'],
    '/customer/review/config/store'),
  pdpEvaluate: (params) => wxRequest(params, baseUrl, '/cloud-review-service', envJson['/cloud-review-service'],
    '/customer/review/pdp'),
  goodsEvaluateState: (params, paramsJson) => wxRequest(params, baseUrl, '/cloud-review-service', envJson[
    '/cloud-review-service'], '/customer/review/item/status?storeId=' + paramsJson.storeId + '&orderId=' +
  paramsJson.orderId),
  orderGoodsEvaluateState: (params) => wxRequest(params, baseUrl, '/cloud-review-service', envJson[
    '/cloud-review-service'], '/customer/review/status'),
  myEvaluateList: (params, paramsJson) => wxRequest(params, baseUrl, '/cloud-review-service', envJson[
    '/cloud-review-service'], '/customer/review/my?storeId=' + paramsJson.storeId + '&pageNo=' + paramsJson.pageNo +
    '&pageSize=' + paramsJson.pageSize + '&skuCode=' + paramsJson.skuCode + '&orderCode=' + paramsJson.orderCode),
  addEvaluate: (params) => wxRequest(params, baseUrl, '/cloud-review-service', envJson['/cloud-review-service'],
    '/customer/review/add'),
  tagsList: (params, itemId) => wxRequest(params, baseUrl, '/cloud-review-service', envJson['/cloud-review-service'],
    '/customer/review/tag/tags?itemId=' + itemId),
  //查询我的订单
  getMyOrderListWithEvaluation: (params) => wxRequestWithTime(params, baseUrl, '/cloud-review-service', envJson[
    '/cloud-review-service'], '/customer/review/sales_order'),
  getEvaluationPoint: (params) => wxRequest(params, baseUrl, '/cloud-review-service', envJson[
    '/cloud-review-service'], '/customer/review/point'),


  // /app-buyer-show
  // requestUGCUploadFile: baseUrl, '/app-buyer-show', envJson['/app-buyer-show'], '/customer/ugc/uploadPhoto',
  // uploadFile: apiCRMUrl + '/basic-storage-tencent-cos/file?bucketName=100000000&key=log/test.log',
  // 图片上传
  uploadFile: (params) => wxRequest(params, baseUrl, '/basic-storage-tencent-cos', envJson[
    '/basic-storage-tencent-cos'], '/file?bucketName=100000000&key=log/test.log'),
  uploadFiles: baseUrl + '/basic-storage-tencent-cos/file?bucketName=100000000',
  uploadFiles2: 'https://api.cloud.efashionchina.com/basic-storage-tencent-cos/file?bucketName=100000000',
  // uploadFiles: 'https://api.sandbox.cloud.efashionchina.com/basic-storage-tencent-cos/file?bucketName=100000000',
  // uploadFile: (params) => wxRequest(params, baseUrl, '/basic-storage-tencent-cos', envJson['/basic-storage-tencent-cos'], '/file?bucketName=100000000&key=log/test.log'),
  // 图片过滤
  imageCheck: (params, app_id) => wxRequest(params, baseUrl, '/cloud-weixin-mini', envJson['/cloud-weixin-mini'],
    '/sec_check/image_check?app_id=' + app_id),

  // /cloud-weixin-subscribe
  // 开售订阅
  getSaleMessage: (params) => wxRequest(params, baseUrl, '/cloud-weixin-subscribe', envJson['/cloud-weixin-subscribe'],
    '/customer/wx_subscribe_request/get'),
  sendSaleMessage: (params) => wxRequest(params, baseUrl, '/cloud-weixin-subscribe', envJson['/cloud-weixin-subscribe'],
    '/customer/wx_subscribe_request/subscribe'),

  //分享海报页太阳码
  flashSaleQrCode: (params) => wxRequest(params, baseUrl, '/activation-code-service', envJson[
    '/activation-code-service'], '/customer/qrcode/new'),
  // 获取会员信息
  getLevelLists: (params) => wxRequest(params, baseUrl, '/crm-member-basic', envJson['/crm-member-basic'],
    '/customer/member/exp-logs'),
  // 修改头像
  updateAvatarUrl: (params) => wxRequest(params, baseUrl, '/cloud-customer-basic', envJson[
    '/cloud-customer-basic'], '/customer/customer/nick_name_and_url'),
  // 文章点赞总数
  articleLikeList: (params) => wxRequest(params, baseUrl, '/cloud-like-service', envJson['/cloud-like-service'],
    '/customer/like/info/list'),
  //文章点赞信息
  articleLikeInfo: (params) => wxRequest(params, baseUrl, '/cloud-like-service', envJson['/cloud-like-service'],
    '/customer/like/info'),
  // 文章点赞
  articleGood: (params) => wxRequest(params, baseUrl, '/cloud-like-service', envJson['/cloud-like-service'],
    '/customer/like'),

  // 限购件数
  limitPurchase: (params) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson['/cloud-sales-order'],
    '/customer/sales_order/limit_purchase/get'),

  //甄选佳酿
  //获取活动基本信息
  getDrawInfo: (params) => wxRequest(params, baseUrl, '/cloud-sales-discount', envJson['/cloud-sales-discount'],
    '/customer/activity_selection'),
  drawItNow: (params) => wxRequest(params, baseUrl, '/cloud-sales-discount', envJson['/cloud-sales-discount'],
    '/customer/activity_selection/join_draw'),
  sendSubMessage: (params) => wxRequest(params, baseUrl,
    '/cloud-weixin-subscribe', envJson['/cloud-weixin-subscribe'], '/customer/wx_subscribe_request/subscribe'),
  //是否符合组别
  verifyDrawIdentify: (params, activity_selection_id) => wxRequest(params, baseUrl, '/cloud-sales-discount',
    envJson['/cloud-sales-discount'],
    '/customer/activity_selection/check_group?activity_selection_id=' + activity_selection_id),
  // 抽签购参与记录
  recordList: (params) => wxRequest(params, baseUrl, '/cloud-sales-discount', envJson['/cloud-sales-discount'],
    '/customer/activity_selection_record'),
  // 抽签购立即参与判断地区是否允许参与
  checkDrawDistrict: (params) => wxRequest(params, baseUrl, '/cloud-sales-discount', envJson[
    '/cloud-sales-discount'],
    '/customer/activity_selection/check_allow_join_district'),

  // 会员礼遇
  //查询用户是否访问过活动
  getActivityList: (params) => wxRequest(params, baseUrl, '/crm-social-event', envJson['/crm-social-event'],
    '/customer/meet/visit/accessible/list'),

  setVisitActive: (params) => wxRequest(params, baseUrl, '/crm-social-event', envJson['/crm-social-event'],
    '/customer/meet/visit'),
  // 查询礼品详情
  getGiftDetail: (params, id) => wxRequest(params, baseUrl, '/crm-social-event', envJson['/crm-social-event'],
    '/customer/meet/gift/' + id),
  // 查看礼品是否已领取
  getGiftStatus: (params, id) => wxRequest(params, baseUrl, '/crm-social-event', envJson['/crm-social-event'],
    '/customer/meet/gift/received/status/' + id),
  // 查看礼品库存
  getGiftStock: (params, id) => wxRequest(params, baseUrl, '/crm-social-event', envJson['/crm-social-event'],
    '/customer/meet/gift/stock/' + id),
  // 查看礼品申请记录
  getReceiveInfo: (params, id) => wxRequest(params, baseUrl, '/crm-social-event', envJson['/crm-social-event'],
    '/customer/meet/gift/receive/' + id),
  // 申领礼品
  applyGift: (params) => wxRequest(params, baseUrl, '/crm-social-event', envJson['/crm-social-event'],
    '/customer/meet/gift/receive'),
  // 顾问邀约
  // 查询邀约信息
  getConsultantInfo: (params, id) => wxRequest(params, baseUrl, '/crm-social-event', envJson[
    '/crm-social-event'], '/customer/meet/adviser/' + id),
  accpectInvite: (params) => wxRequest(params, baseUrl, '/crm-social-event', envJson['/crm-social-event'],
    '/customer/meet/adviser/accept'),

  // 特约
  getSpecialInviteInfo: (params, id) => wxRequest(params, baseUrl, '/crm-social-event', envJson[
    '/crm-social-event'], '/customer/meet/special/' + id),

  // 不发货地区
  checkDistrict: (params) => wxRequest(params, baseUrl, '/cloud-sales-order', envJson['/cloud-sales-order'],
    '/customer/sales_order/check_reach_area '),

  // GTR
  //查询门店商品列表
  getStoreGoodsList: (params) => wxRequest(params, baseUrl, '/retail-store-extend', envJson[
    '/retail-store-extend'], '/customer/store/item/list'), // 查询门店商品详情
  storeGoodsDetail: (params, id) => wxRequest(params, baseUrl, '/retail-store-extend', envJson[
    '/retail-store-extend'],
    '/customer/store/item/' + id),
  // 门店列表
  storeAddressList: (params, id) => wxRequest(params, baseUrl, '/retail-store-extend', envJson[
    '/retail-store-extend'],
    '/customer/store/list'),

  // /cloud-sales-discount
  // 根据id查询活动消息详情
  queryActivitySubscribeDetail: (params, activityId) => wxRequest(params, baseUrl, '/cloud-sales-discount', envJson[
    '/cloud-sales-discount'], '/customer/activity_subscribe/' + activityId),
  // 根据id查询活动消息详情(非会员)
  queryGuestActivitySubscribeDetail: (params, activity_subscribe_id, merchant_id) => wxRequest(params, baseUrl,
    '/cloud-sales-discount', envJson[
  '/cloud-sales-discount'],
    `/customer/activity_subscribe/get/guest?activity_subscribe_id=${activity_subscribe_id}&merchant_id=${merchant_id}`
  ),

  // /cloud-weixin-subscribe
  // 订阅活动服务消息
  weixinSubscribe: (params) => wxRequest(params, baseUrl, '/cloud-weixin-subscribe', envJson['/cloud-weixin-subscribe'],
    '/customer/wx_subscribe_request/subscribe'),
  // 订阅活动服务消息(非会员)
  guestWeixinSubscribe: (params) => wxRequest(params, baseUrl, '/cloud-weixin-subscribe', envJson[
    '/cloud-weixin-subscribe'],
    '/customer/wx_subscribe_request/subscribe/guest'),
  //获取订阅消息状态
  getweixinSubscribe: (params) => wxRequest(params, baseUrl, '/cloud-weixin-subscribe', envJson[
    '/cloud-weixin-subscribe'], '/customer/wx_subscribe_request/get'),
  //获取订阅消息状态(非会员)
  getGuestWeixinSubscribe: (params) => wxRequest(params, baseUrl, '/cloud-weixin-subscribe', envJson[
    '/cloud-weixin-subscribe'], '/customer/wx_subscribe_request/get/guest'),
  // 分享数据
  // 记录
  recordShare: (params) => wxRequest(params, baseUrl, '/cloud-share-service', envJson['/cloud-share-service'],
    '/customer/share/record'),
  // 统计
  statShare: (params) => wxRequest(params, baseUrl, '/cloud-share-service', envJson['/cloud-share-service'],
    '/customer/share/stat'),
  // 隐私协议
  getPolicyStatus: (params) => wxRequest(params, baseUrl, '/crm-member-basic', envJson['/crm-member-basic'],
    '/customer/member/agreement'),
  setPolicyStatus: (params) => wxRequest(params, baseUrl, '/crm-member-basic', envJson['/crm-member-basic'],
    '/customer/member/agreement'),
  // 任务中心

  // 初始化任务中心
  setTaskInit: (params) => wxRequest(params, baseUrl, '/crm-member-task', envJson['/crm-member-task'],
    '/customer/task/init'),
  // 查看任务列表及奖励
  getTaskInfo: (params) => wxRequest(params, baseUrl, '/crm-member-task', envJson['/crm-member-task'],
    '/customer/task'),
  // 完成任务
  finishTask: (params) => wxRequest(params, baseUrl, '/crm-member-task', envJson['/crm-member-task'],
    '/customer/task/finish'),
  // 查看邀请好友
  getInvitedFriends: (params) => wxRequest(params, baseUrl, '/crm-member-task', envJson['/crm-member-task'],
    '/customer/task/invite-friends'),
  // 查看任务规则
  getTaskRule: (params) => wxRequest(params, baseUrl, '/crm-member-task', envJson['/crm-member-task'],
    '/customer/task/rule'),
  // 查看任务记录
  getTaskRecord: (params) => wxRequest(params, baseUrl, '/crm-member-task', envJson['/crm-member-task'],
    '/customer/task/record'),
  // 邀请助力校验
  helpValid: (params) => wxRequest(params, baseUrl, '/crm-member-task', envJson['/crm-member-task'],
    '/customer/task/invite-help/valid'),
  //好友助力
  helpComfirm: (params) => wxRequest(params, baseUrl, '/crm-member-task', envJson['/crm-member-task'],
    '/customer/task/confirm-completed'),
  memberCode: (params) => wxRequest(params, baseUrl, '/cloud-customer-basic', envJson['/cloud-customer-basic'],
    '/customer/customer/member_code'),
  //查询任务中心默认抽签次数
  getTaskDeafultCount: (params) => wxRequest(params, baseUrl, '/crm-member-task', envJson['/crm-member-task'],
    '/customer/task/draw-count'),
  //PDP限行地址
  pdpRestrictAddress: (params) => wxRequest(params, baseUrl, '/cloud-item-basic', envJson['/cloud-item-basic'],
    '/customer/item_sku/restrict_address'),
  //立即助力统计
  trackInvite: (params) => wxRequest(params, baseUrl, '/crm-member-task', envJson['/crm-member-task'],
    '/customer/task/track/invite'),
  //获取服务器时间
  getServerTime: (params) => wxRequest(params, baseUrl, '/basic-china-area', envJson['/basic-china-area'],
    '/server_date/timestamp'),
  // 通过活动id校验用户身份信息
  getTsById: (params, id) => wxRequest(params, baseUrl, '/target-sales-service', envJson['/target-sales-service'],
    '/customer/' + id),
  // 通过ID查询不校验身份
  getTsInfoNoLogin: (params, id) => wxRequest(params, baseUrl, '/target-sales-service', envJson[
    '/target-sales-service'],
    '/customer/' + id + '/view'),
  // 首页获取用户活动信息
  getTsByUser: (params) => wxRequest(params, baseUrl, '/target-sales-service', envJson['/target-sales-service'],
    '/customer/effective'),
  // 通过sku查ts活动信息
  getTsBySku: (params) => wxRequest(params, baseUrl, '/target-sales-service', envJson['/target-sales-service'],
    '/customer/by_sku'),
  // 通过手机号查ts活动信息
  getTsByPhoneNumber: (params, phone) => wxRequest(params, baseUrl, '/target-sales-service', envJson[
    '/target-sales-service'],
    '/customer/' + phone + '/check_mobile'),
  // ts活动登记
  checkInTs: (params, phone) => wxRequest(params, baseUrl, '/target-sales-service', envJson[
    '/target-sales-service'],
    '/customer/campaign/selection/checkin'),

  //通过union-id获取手机号
  getPhoneByUnion: (params, unionid) => wxRequest(params, baseUrl, '/crm-integration-convertlab', envJson[
    '/crm-integration-convertlab'],
    '/customer/member/check_info/union_id/' + unionid),
  //通过手机号获取union-id
  getUnionByPhone: (params, phone) => wxRequest(params, baseUrl, '/crm-integration-convertlab', envJson[
    '/crm-integration-convertlab'],
    '/customer/member/check_info/mobile/' + phone),
  //新品订阅
  bookSubscribe: (params) => wxRequest(params, baseUrl, '/target-sales-service', envJson['/target-sales-service'],
    '/customer/subscribe'),

  // 存储元素
  setElementStatus: (params) => wxRequest(params, baseUrl, '/macallan-game-service', envJson['/macallan-game-service'],
    '/element/saveUserElement'),

  // 查询元素
  getElementStatus: (params) => wxRequest(params, baseUrl, '/macallan-game-service', envJson['/macallan-game-service'],
    '/element/getUserElementList'),
  // 获取我的心愿单
  getWishList: (params) => wxRequest(params, baseUrl, '/cloud-customer-basic', envJson['/cloud-customer-basic'],
    '/customer/favorites/get'),
  // 添加删除心愿单
  setFav: (params) => wxRequest(params, baseUrl, '/cloud-customer-basic', envJson['/cloud-customer-basic'],
    '/customer/favorites/set'),
  // 判断商品是否收藏
  checkFavStatus: (params) => wxRequest(params, baseUrl, '/cloud-customer-basic', envJson['/cloud-customer-basic'],
    '/customer/favorites/check'),
  setScence: (params) => wxRequest(params, baseUrl, '/basic-map-service', envJson['/basic-map-service'], '/map'),
  getScence: (params, key) => wxRequest(params, baseUrl, '/basic-map-service', envJson['/basic-map-service'], '/map/' +
    key),
  createSunCode: (params) => wxRequest(params, baseUrl, '/cloud-weixin-mini', envJson['/cloud-weixin-mini'],
    '/customer/wx/qrcode/generate'),
  //  获取utools json数据
  getUtoolsJson: (params) => wxRequest(params, baseUrl, '/macallan-revamp-mp', envJson['/macallan-revamp-mp'],
    `/revamp/com/project/customer/api/mini/page/${params.type}`),
  //  根据utoolsId获取 json数据
  getUtoolsJsonById: (params) => wxRequest(params, baseUrl, '/macallan-revamp-mp', envJson['/macallan-revamp-mp'],
    `/revamp/com/project/customer/api/mini/page/utools/${params.utoolsId}`),
  //  根据活动id查utools
  getUtoolsJsonByActivity: (params) => wxRequest(params, baseUrl, '/macallan-revamp-mp', envJson['/macallan-revamp-mp'],
    `/revamp/com/project/customer/api/mini/page/activity/${params.type}/${params.activityId}`),

  //  预览 获取未发布的utools数据
  getUtoolsJsonP: (params) => wxRequest(params, baseUrl, '/macallan-revamp-mp', envJson['/macallan-revamp-mp'],
    `/revamp/com/project/customer/api/mini/page/${params.type}?utoolsId=${params.utoolsId || 0}`),
  //  购物车-最近浏览 列表查询
  getRecentBrowsing: (params) => wxRequest(params, baseUrl, '/macallan-revamp-mp', envJson['/macallan-revamp-mp'],
    `/revamp/com/project/customer/api/pastRecord/record?open_id=${params.open_id}`),
  //  购物车-最近浏览 新增浏览数据
  saveRecentBrowsing: (params, open_id) => wxRequest(params, baseUrl, '/macallan-revamp-mp', envJson[
    '/macallan-revamp-mp'],
    `/revamp/com/project/customer/api/pastRecord/save?open_id=${open_id}`),
  //  批量查询实时库存
  getAvailableBatchQty: (params, merchant_id) => wxRequest(params, baseUrl, '/cloud-item-inventory',
    envJson['/cloud-item-inventory'], '/customer/item_sku/exact_qty/batch/' + merchant_id),

  //获取关联标签
  getItemTag: (params, merchant_id) => wxRequest(params, baseUrl, '/macallan-revamp-mp',
    envJson['/macallan-revamp-mp'], '/revamp/com/project/customer/api/mini/item/package/' + params.itemId),
  //  根据utoolsId获取 json数据
  getUtoolsJsonByRelevance: (params) => wxRequest(params, baseUrl, '/macallan-revamp-mp', envJson[
    '/macallan-revamp-mp'],
    `/revamp/com/project/customer/api/mini/page/relevance/${params.type}/${params.relevance}`),

  //  获取基础样式配置详情
  getBasicsTag: (params) => wxRequest(params, baseUrl, '/macallan-revamp-mp', envJson['/macallan-revamp-mp'],
    `/revamp/com/project/customer/api/mini/basics/${params.key}`),

  // 神策utm参数数据保存,首先需要EB小程序前端生成订单后，前端开发人员必须先调用utm保存接口，将EB前端计算后的渠道投放信息保存到cloud 数据库中，关联相应的订单。
  saveUtmInfoByOrder: (params) => wxRequest(params, baseUrl, '/basic-map-service', envJson['/basic-map-service'],
    `/customer/map`),

  //  查询页面配置的分享图片和标题
  getShareinfoByCode: (params) => wxRequest(params, baseUrl, '/macallan-revamp-mp', envJson['/macallan-revamp-mp'],
    `/revamp/com/project/customer/api/mini/share/page/${params.code}`),

  //  心愿单 分享内容存储
  saveShareInfo: (params) => wxRequest(params, baseUrl, '/macallan-revamp-mp', envJson['/macallan-revamp-mp'],
    `/revamp/com/project/customer/api/miniShare/save`),
  //  心愿单 分享内容查询
  getShareInfoById: (params) => wxRequest(params, baseUrl, '/macallan-revamp-mp', envJson['/macallan-revamp-mp'],
    `/revamp/com/project/customer/api/miniShare/getOne/${params.shareId}`),
  //  查询配置弹窗信息
  getDataInfoByIdAndType: (params) => wxRequest(params, baseUrl, '/macallan-revamp-mp', envJson['/macallan-revamp-mp'],
    `/revamp/com/project/customer/api/mini/page/activity/${params.type}/${params.activityId}`),
  //	c2b定制图片上传
  uploadC2BuserImgs: baseUrl + '/basic-storage-tencent-cos/customer/files',

  //	内容检测V2
  checkTextV2: (params, app_id) => wxRequest(params, baseUrl, '/cloud-weixin-mini', envJson['/cloud-weixin-mini'],
    '/sec_check/sec_check/v2?app_id=' + app_id),

  // 同意定制协议
  agreeAgreement: (params) => wxRequest(params, baseUrl, '/cloud-customer-basic', envJson['/cloud-customer-basic'],
    '/customer/customization_agreement/agree'),
	
	// 全量修改商品数量
	cartUpdateNumFull: (params, cartKey, num, sku_id) => wxRequest(params, baseUrl, '/cloud-sales-cart', envJson[
	  '/cloud-sales-cart'], '/customer/sales_cart/' + cartKey + '/item_full_qty?qty=' + num + '&sku_id=' + sku_id),
	
	//	问卷调查查询接口
	getSurveyListsByCode: (params) => wxRequest(params, baseUrl, '/macallan-revamp-mp', envJson[
	  '/macallan-revamp-mp'], '/revamp/v1/customer/survey/code/'+params.code+'?open_id=' + params.open_id),
	//	收集用户问卷答题记录(单条题目)
	setSurveyAnswerData: (params, open_id) => wxRequest(params, baseUrl, '/macallan-revamp-mp', envJson[
	  '/macallan-revamp-mp'], '/revamp/v1/customer/survey/answer?open_id=' + open_id),
}
